package com.chinasofti.zbestadmin.web;


import com.chinasofti.zbestadmin.dao.OrderMapper;
import com.chinasofti.zbestadmin.dao.model.User;
import com.chinasofti.zbestadmin.dao.model.Zborder;
import com.chinasofti.zbestadmin.service.IOrderService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.stereotype.Controller;

import javax.servlet.http.HttpSession;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * <p>
 * 订单 前端控制器
 * </p>
 *
 * @author zbestadmin
 * @since 2019-05-29
 */
@Controller
@Slf4j
public class OrderController extends BaseController {

    @Autowired
    private OrderMapper orderMapper;
    @Autowired
    private IOrderService service;

    @RequestMapping("/orderList")
    public String orderDelivered(ModelMap modelMap, HttpSession session){

        /**
         * 显示订单
         */
        log.info("orderDelivered");
        List<com.chinasofti.zbest.service.info.OrderInfo> orderDelivers=orderMapper.orderDelivered("waitReceiving","waitShipped");
        modelMap.addAttribute("orderDelivers",orderDelivers);
        log.info("{}",orderDelivers);

        /**
         * 修改发货订单
         */
        log.info("修改发货");
        Map<String,String > Zborder=new HashMap<>();
        Zborder.put("orderNum","orderStatus");
        Map<String, com.chinasofti.zbest.service.info.OrderInfo> updateWaitShipped=orderMapper.updateWaitShipped("orderStatus","orderNum");
        modelMap.addAttribute("updateWaitShipped",updateWaitShipped);
        log.info("{}",updateWaitShipped);

        return "tgls/goodsManage/orderList";
    }
}

